package kmu.lwl.controller;

import kmu.lwl.entiy.Login;
import kmu.lwl.entiy.Student;
import kmu.lwl.imp.SelectDao;
import kmu.lwl.imp.impl.SelectDaoimpl;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import java.util.Map;

public class SelectController extends ActionSupport {
    @Override
    public String execute() throws Exception {
        Map session = (Map)ActionContext.getContext().getSession();
        Login user = (Login) session.get("user");
        SelectDao selectDao = new SelectDaoimpl();
        Student student = selectDao.selectMessage(user.getLoginName());
        Map s = ActionContext.getContext().getSession();
        s.put("student",student);
        return SUCCESS;
    }
}
